home *** CD-ROM | disk | FTP | other *** search
- (*=========================================================================*)
- (* Monitor command for BPQ-HOST *)
- (* *)
- (* Copyright 1992 by H. Roy Engehausen. All rights reserved. *)
- (* *)
- (*=========================================================================*)
-
- (*===========================================================================*)
- (* Process monitor command *)
- (* Results: *)
- (* 0 = no monitor *)
- (* 1 = monitor *)
- (* 2 = command error *)
- (*===========================================================================*)
-
- FUNCTION bpq_monitor_command : BYTE;
-
- VAR
- new_set : BYTE;
- filter : BYTE;
- i : BYTE;
- p : port_block_ptr;
- s : STRING[10];
-
- BEGIN;
-
- (*-----------------------------------------------------------------------*)
- (* Prepare the scan *)
- (*-----------------------------------------------------------------------*)
-
- s := data_place.data_ptr^.str_data;
- upcase_str_var(s);
-
- (*-----------------------------------------------------------------------*)
- (* Just "M"? *)
- (*-----------------------------------------------------------------------*)
-
- IF LENGTH(s) = 1 THEN
- BEGIN;
- bpq_monitor_command := 2;
- EXIT;
- END;
-
- (*-----------------------------------------------------------------------*)
- (* Process the parms *)
- (*-----------------------------------------------------------------------*)
-
- filter := 0;
-
- IF s <> 'MN' THEN
- BEGIN;
-
- (*-------------------------------------------------------------------*)
- (* Scan the letters *)
- (*-------------------------------------------------------------------*)
-
- FOR i := 2 TO LENGTH(s) DO
- BEGIN;
- CASE s[i] OF
- 'I' : new_set := bpq_monitor_i;
- 'U' : new_set := bpq_monitor_ui;
- 'S' : new_set := bpq_monitor_s;
- 'F' : new_set := bpq_monitor_F0;
- 'C' : new_set := bpq_monitor_CF;
- 'A' : new_set := bpq_monitor_other + bpq_monitor_F0
- + bpq_monitor_CF;
- ELSE
- BEGIN;
- bpq_monitor_command := 2;
- EXIT;
- END;
- END;
-
- filter := filter OR new_set;
-
- END;
-
- END;
-
- (*-----------------------------------------------------------------------*)
- (* Default the PID scan to all *)
- (*-----------------------------------------------------------------------*)
-
- IF (filter AND (bpq_monitor_other + bpq_monitor_F0+ bpq_monitor_cf)) = 0
- THEN
- filter := filter + bpq_monitor_other + bpq_monitor_F0 + bpq_monitor_CF;
-
- (*-----------------------------------------------------------------------*)
- (* Set the filter *)
- (*-----------------------------------------------------------------------*)
-
- active_port^.mon_filter := filter;
-
- (*-----------------------------------------------------------------------*)
- (* See if monitor is on anywhere *)
- (*-----------------------------------------------------------------------*)
-
- p := active_port^.main_port;
-
- i := 0;
-
- REPEAT
- {$IFDEF POINT_CHK}
- test_pointer(p);
- {$ENDIF}
- IF active_port^.mon_filter <> 0 THEN
- i := 1;
- p := p^.rel_port;
- UNTIL (p = NIL) OR (i <> 0);
-
- (*-----------------------------------------------------------------------*)
- (* Set the result based on monitor scan results *)
- (*-----------------------------------------------------------------------*)
-
- bpq_monitor_command := i;
-
- (*-----------------------------------------------------------------------*)
- (* Ensure the result is on everybody *)
- (*-----------------------------------------------------------------------*)
-
- p := active_port^.main_port;
- REPEAT
- p^.port_monitor := BOOLEAN(i);
- p := p^.rel_port;
- UNTIL p = NIL;
-
- END;